<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="coinfaces">

        <title>GTK快捷键中怎么表示Enter键</title>

    <link rel="stylesheet" href="../../theme/css/style.css">
    <link rel="stylesheet" href="../../theme/css/pygments.css">



</head>

<body>
    <div class="content">
<h1>GTK快捷键中怎么表示Enter键</h1>    <p>
        under
            <a href="../../tags/lxterminal/">lxterminal</a>
            <a href="../../tags/gtk/">gtk</a>
    </p>
    <p>
        in <a href="../../categories/tech/">tech</a>
    </p>
    <p>Published: 2016-10-31</p>


    <p>想用<tt class="docutils literal">Control+Shift+Enter</tt>代替lxterminal里默认的“新建Tab”快捷键<tt class="docutils literal">Contorl+Shift+T</tt>，我知道在“Preferences-&gt;Shortcuts”里可以修改快捷键绑定，但由于这个界面不支持按键的方式来设置快捷键，必须输入快捷键的表示（比如<tt class="docutils literal"><span class="pre">&lt;CTRL&gt;&lt;SHIFT&gt;T</span></tt>），但无论怎么尝试（各种大小写组合、加或者不加尖括号）都无法表示“Enter”键。</p>
<p>没有找到相关文档，只好翻源代码。根据<a class="reference external" href="https://github.com/lxde/lxterminal">lxterminal源代码</a>中src/lxterminal.c里的<tt class="docutils literal">terminal_update_menu_shortcuts</tt>找到了负责解析快捷键的<tt class="docutils literal">gtk_accelerator_parse</tt>函数，但这个函数的文档中也没有看到Enter键的表示方法，只好继续查找<a class="reference external" href="https://git.gnome.org/browse/gtk+">Gtk+源代码</a>，最后在gdk/keyname-table.h里找到了答案：“Return”，首字母大写。</p>
<p>（完）</p>

    </div>
<nav class="nav sidebar">
    <div class="siteinfo">
        <div class="sitename"><a href="../..">coinfaces</a></div>
        <div class="tagline">Another Side of Life</div>
    </div>

        <a href="../../categories/">categories</a>
        <a href="../..">&larr; Home</a>
</nav><footer class="footer">
    <span>
        &copy; jpli &middot;
        under <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">CC-BY-SA 4.0</a>
    </span>
    |
    <span>
        Powered by:
        <a href="http://blog.getpelican.com/">Pelican</a>
    </span>
</footer></body>
</html>